\hypertarget{motherboard_2usart_8h}{
\section{motherboard/usart.h File Reference}
\label{motherboard_2usart_8h}\index{motherboard/usart.h@{motherboard/usart.h}}
}
Motherboard USART routines.  


{\tt \#include \char`\"{}../global.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned char \hyperlink{motherboard_2usart_8h_4d13995e1d38d3f790237fa5ca309737}{poll\_\-usart0\_\-receive} (void)
\begin{CompactList}\small\item\em Retrieve one character from the USART0 Retrieve one character from the USART. With this function you will need to poll the USART, it does NOT wait until a character is in the buffer. \item\end{CompactList}\item 
void \hyperlink{motherboard_2usart_8h_482841a880dc7de7f575b6d2f6297b39}{usart0\_\-init} (unsigned int baudrate)
\begin{CompactList}\small\item\em Initiliaze the USART0 for the communication bus This function is used to initialize the USART which a baudrate that needs to be sent in as a parameter Use the baudrate settings specified in the ATMEGA2560 baudrate setting. \item\end{CompactList}\item 
\hypertarget{motherboard_2usart_8h_aa032a20c4e047a8d5d7c607575b92aa}{
unsigned char \textbf{usart0\_\-transmit} (unsigned char data)}
\label{motherboard_2usart_8h_aa032a20c4e047a8d5d7c607575b92aa}

\item 
unsigned char \hyperlink{motherboard_2usart_8h_3d365b96b6297b6163936bdcffc7f008}{usart0\_\-receive} (void)
\begin{CompactList}\small\item\em Retrieve one character from the USART0 Retrieve one character from the USART. This function will wait until there is a character in the USART RX buffer. \item\end{CompactList}\item 
unsigned char \hyperlink{motherboard_2usart_8h_a397c495b75a8bbfba1128f73a3982c7}{usart0\_\-receive\_\-loopback} (void)
\begin{CompactList}\small\item\em The USART0 recieve loopback This function does wait for a character in the RX buffer and returns it to the transmit buffer. \item\end{CompactList}\item 
unsigned char \hyperlink{motherboard_2usart_8h_112a22f41602b42bacbdb0ffac04a59e}{usart0\_\-sendstring} (char $\ast$data, unsigned char length)
\begin{CompactList}\small\item\em Send a string of characters to the USART0 Send a string of characters to the USART used for the communication bus. \item\end{CompactList}\item 
unsigned char \hyperlink{motherboard_2usart_8h_b1455e6900de4811aed2ae872667e154}{poll\_\-usart1\_\-receive} (void)
\begin{CompactList}\small\item\em Retrieve one character from the USART1 Retrieve one character from the USART. With this function you will need to poll the USART, it does NOT wait until a character is in the buffer. \item\end{CompactList}\item 
void \hyperlink{motherboard_2usart_8h_bbe97057bc5a47d8b3c5f4c5a9993b35}{usart1\_\-init} (unsigned int baudrate)
\begin{CompactList}\small\item\em Initiliaze the USART for the communication bus This function is used to initialize the USART which a baudrate that needs to be sent in as a parameter Use the baudrate settings specified in the ATMEGA128 baudrate setting. \item\end{CompactList}\item 
\hypertarget{motherboard_2usart_8h_ccfd97c8cc3b9dd3cd7f21da9402770a}{
unsigned char \textbf{usart1\_\-transmit} (unsigned char data)}
\label{motherboard_2usart_8h_ccfd97c8cc3b9dd3cd7f21da9402770a}

\item 
unsigned char \hyperlink{motherboard_2usart_8h_ef7249709ccfaf69979236bc31c3b184}{usart1\_\-receive} (void)
\begin{CompactList}\small\item\em Retrieve one character from the USART1 Retrieve one character from the USART. This function will wait until there is a character in the USART RX buffer. \item\end{CompactList}\item 
unsigned char \hyperlink{motherboard_2usart_8h_86add9375c019696ca7631ee20f2d6d6}{usart1\_\-receive\_\-loopback} (void)
\begin{CompactList}\small\item\em The USART1 recieve loopback This function does wait for a character in the RX buffer and returns it to the transmit buffer. \item\end{CompactList}\item 
unsigned char \hyperlink{motherboard_2usart_8h_2dc2350f52fc5e6d4579f6e24f477ab2}{usart1\_\-sendstring} (char $\ast$data, unsigned char length)
\begin{CompactList}\small\item\em Send a string of characters to the USART1 Send a string of characters to the USART used for the communication bus. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Motherboard USART routines. 

\begin{Desc}
\item[Author:]Mikael Larsmark, SM2WMV \end{Desc}
\begin{Desc}
\item[Date:]2010-01-25 

\begin{Code}\begin{verbatim} #include "motherboard/usart.h" 
\end{verbatim}
\end{Code}

 \end{Desc}


Definition in file \hyperlink{motherboard_2usart_8h-source}{usart.h}.

\subsection{Function Documentation}
\hypertarget{motherboard_2usart_8h_4d13995e1d38d3f790237fa5ca309737}{
\index{motherboard/usart.h@{motherboard/usart.h}!poll\_\-usart0\_\-receive@{poll\_\-usart0\_\-receive}}
\index{poll\_\-usart0\_\-receive@{poll\_\-usart0\_\-receive}!motherboard/usart.h@{motherboard/usart.h}}
\subsubsection[{poll\_\-usart0\_\-receive}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char poll\_\-usart0\_\-receive (void)}}
\label{motherboard_2usart_8h_4d13995e1d38d3f790237fa5ca309737}


Retrieve one character from the USART0 Retrieve one character from the USART. With this function you will need to poll the USART, it does NOT wait until a character is in the buffer. 

\begin{Desc}
\item[Returns:]The character from the RX USART buffer\end{Desc}
Retrieve one character from the USART0 Retrieve one character from the USART. With this function you will need to poll the USART, it does NOT wait until a character is in the buffer.

\begin{Desc}
\item[Returns:]The character from the RX USART buffer \end{Desc}


Definition at line 100 of file usart.c.\hypertarget{motherboard_2usart_8h_b1455e6900de4811aed2ae872667e154}{
\index{motherboard/usart.h@{motherboard/usart.h}!poll\_\-usart1\_\-receive@{poll\_\-usart1\_\-receive}}
\index{poll\_\-usart1\_\-receive@{poll\_\-usart1\_\-receive}!motherboard/usart.h@{motherboard/usart.h}}
\subsubsection[{poll\_\-usart1\_\-receive}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char poll\_\-usart1\_\-receive (void)}}
\label{motherboard_2usart_8h_b1455e6900de4811aed2ae872667e154}


Retrieve one character from the USART1 Retrieve one character from the USART. With this function you will need to poll the USART, it does NOT wait until a character is in the buffer. 

\begin{Desc}
\item[Returns:]The character from the RX USART buffer\end{Desc}
Retrieve one character from the USART1 Retrieve one character from the USART. With this function you will need to poll the USART, it does NOT wait until a character is in the buffer.

\begin{Desc}
\item[Returns:]The character from the RX USART buffer \end{Desc}


Definition at line 185 of file usart.c.\hypertarget{motherboard_2usart_8h_482841a880dc7de7f575b6d2f6297b39}{
\index{motherboard/usart.h@{motherboard/usart.h}!usart0\_\-init@{usart0\_\-init}}
\index{usart0\_\-init@{usart0\_\-init}!motherboard/usart.h@{motherboard/usart.h}}
\subsubsection[{usart0\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}void usart0\_\-init (unsigned int {\em baudrate})}}
\label{motherboard_2usart_8h_482841a880dc7de7f575b6d2f6297b39}


Initiliaze the USART0 for the communication bus This function is used to initialize the USART which a baudrate that needs to be sent in as a parameter Use the baudrate settings specified in the ATMEGA2560 baudrate setting. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em baudrate}]The baudrate param from the ATMEGA2560 datasheet.\end{description}
\end{Desc}
Initiliaze the USART0 for the communication bus This function is used to initialize the USART which a baudrate that needs to be sent in as a parameter Use the baudrate settings specified in the ATMEGA2560 baudrate setting.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em baud}]The baudrate param from the ATMEGA32 datasheet. \end{description}
\end{Desc}


Definition at line 34 of file usart.c.

Referenced by init\_\-usart(), and main().\hypertarget{motherboard_2usart_8h_3d365b96b6297b6163936bdcffc7f008}{
\index{motherboard/usart.h@{motherboard/usart.h}!usart0\_\-receive@{usart0\_\-receive}}
\index{usart0\_\-receive@{usart0\_\-receive}!motherboard/usart.h@{motherboard/usart.h}}
\subsubsection[{usart0\_\-receive}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char usart0\_\-receive (void)}}
\label{motherboard_2usart_8h_3d365b96b6297b6163936bdcffc7f008}


Retrieve one character from the USART0 Retrieve one character from the USART. This function will wait until there is a character in the USART RX buffer. 

\begin{Desc}
\item[Returns:]The character from the RX USART buffer\end{Desc}
Retrieve one character from the USART0 Retrieve one character from the USART. This function will wait until there is a character in the USART RX buffer.

\begin{Desc}
\item[Returns:]The character from the RX USART buffer \end{Desc}


Definition at line 73 of file usart.c.\hypertarget{motherboard_2usart_8h_a397c495b75a8bbfba1128f73a3982c7}{
\index{motherboard/usart.h@{motherboard/usart.h}!usart0\_\-receive\_\-loopback@{usart0\_\-receive\_\-loopback}}
\index{usart0\_\-receive\_\-loopback@{usart0\_\-receive\_\-loopback}!motherboard/usart.h@{motherboard/usart.h}}
\subsubsection[{usart0\_\-receive\_\-loopback}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char usart0\_\-receive\_\-loopback (void)}}
\label{motherboard_2usart_8h_a397c495b75a8bbfba1128f73a3982c7}


The USART0 recieve loopback This function does wait for a character in the RX buffer and returns it to the transmit buffer. 

\begin{Desc}
\item[Returns:]The character from the RX USART buffer\end{Desc}
The USART0 recieve loopback This function does wait for a character in the RX buffer and returns it to the transmit buffer.

\begin{Desc}
\item[Returns:]The character from the RX USART buffer \end{Desc}


Definition at line 85 of file usart.c.

References usart0\_\-transmit().

Referenced by init\_\-usart().\hypertarget{motherboard_2usart_8h_112a22f41602b42bacbdb0ffac04a59e}{
\index{motherboard/usart.h@{motherboard/usart.h}!usart0\_\-sendstring@{usart0\_\-sendstring}}
\index{usart0\_\-sendstring@{usart0\_\-sendstring}!motherboard/usart.h@{motherboard/usart.h}}
\subsubsection[{usart0\_\-sendstring}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char usart0\_\-sendstring (char $\ast$ {\em data}, \/  unsigned char {\em length})}}
\label{motherboard_2usart_8h_112a22f41602b42bacbdb0ffac04a59e}


Send a string of characters to the USART0 Send a string of characters to the USART used for the communication bus. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]The string of characters you wish to send \item[{\em length}]The length of the string you wish to send\end{description}
\end{Desc}
Send a string of characters to the USART0 Send a string of characters to the USART used for the communication bus.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]The string of characters you wish to send \item[{\em length}]The length of the string you wish to send \end{description}
\end{Desc}


Definition at line 60 of file usart.c.

References usart0\_\-transmit().\hypertarget{motherboard_2usart_8h_bbe97057bc5a47d8b3c5f4c5a9993b35}{
\index{motherboard/usart.h@{motherboard/usart.h}!usart1\_\-init@{usart1\_\-init}}
\index{usart1\_\-init@{usart1\_\-init}!motherboard/usart.h@{motherboard/usart.h}}
\subsubsection[{usart1\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}void usart1\_\-init (unsigned int {\em baudrate})}}
\label{motherboard_2usart_8h_bbe97057bc5a47d8b3c5f4c5a9993b35}


Initiliaze the USART for the communication bus This function is used to initialize the USART which a baudrate that needs to be sent in as a parameter Use the baudrate settings specified in the ATMEGA128 baudrate setting. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em baudrate}]The baudrate param from the ATMEGA32 datasheet. \end{description}
\end{Desc}


Definition at line 112 of file usart.c.\hypertarget{motherboard_2usart_8h_ef7249709ccfaf69979236bc31c3b184}{
\index{motherboard/usart.h@{motherboard/usart.h}!usart1\_\-receive@{usart1\_\-receive}}
\index{usart1\_\-receive@{usart1\_\-receive}!motherboard/usart.h@{motherboard/usart.h}}
\subsubsection[{usart1\_\-receive}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char usart1\_\-receive (void)}}
\label{motherboard_2usart_8h_ef7249709ccfaf69979236bc31c3b184}


Retrieve one character from the USART1 Retrieve one character from the USART. This function will wait until there is a character in the USART RX buffer. 

\begin{Desc}
\item[Returns:]The character from the RX USART buffer\end{Desc}
Retrieve one character from the USART1 Retrieve one character from the USART. This function will wait until there is a character in the USART RX buffer.

\begin{Desc}
\item[Returns:]The character from the RX USART buffer \end{Desc}


Definition at line 158 of file usart.c.\hypertarget{motherboard_2usart_8h_86add9375c019696ca7631ee20f2d6d6}{
\index{motherboard/usart.h@{motherboard/usart.h}!usart1\_\-receive\_\-loopback@{usart1\_\-receive\_\-loopback}}
\index{usart1\_\-receive\_\-loopback@{usart1\_\-receive\_\-loopback}!motherboard/usart.h@{motherboard/usart.h}}
\subsubsection[{usart1\_\-receive\_\-loopback}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char usart1\_\-receive\_\-loopback (void)}}
\label{motherboard_2usart_8h_86add9375c019696ca7631ee20f2d6d6}


The USART1 recieve loopback This function does wait for a character in the RX buffer and returns it to the transmit buffer. 

\begin{Desc}
\item[Returns:]The character from the RX USART buffer\end{Desc}
The USART1 recieve loopback This function does wait for a character in the RX buffer and returns it to the transmit buffer.

\begin{Desc}
\item[Returns:]The character from the RX USART buffer \end{Desc}


Definition at line 170 of file usart.c.

References usart0\_\-transmit(), and usart1\_\-transmit().

Referenced by init\_\-usart\_\-computer(), and main().\hypertarget{motherboard_2usart_8h_2dc2350f52fc5e6d4579f6e24f477ab2}{
\index{motherboard/usart.h@{motherboard/usart.h}!usart1\_\-sendstring@{usart1\_\-sendstring}}
\index{usart1\_\-sendstring@{usart1\_\-sendstring}!motherboard/usart.h@{motherboard/usart.h}}
\subsubsection[{usart1\_\-sendstring}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char usart1\_\-sendstring (char $\ast$ {\em data}, \/  unsigned char {\em length})}}
\label{motherboard_2usart_8h_2dc2350f52fc5e6d4579f6e24f477ab2}


Send a string of characters to the USART1 Send a string of characters to the USART used for the communication bus. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]The string of characters you wish to send \item[{\em length}]The length of the string you wish to send\end{description}
\end{Desc}
Send a string of characters to the USART1 Send a string of characters to the USART used for the communication bus.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]The string of characters you wish to send \item[{\em length}]The length of the string you wish to send \end{description}
\end{Desc}


Definition at line 145 of file usart.c.

References usart1\_\-transmit().